package com.plateform.shardingspherejdbc.contoller;

import com.plateform.shardingspherejdbc.domain.TpressureData;
import com.plateform.shardingspherejdbc.service.TpressureDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.List;

/**
 * @ClassName TpressureDataContoller
 * @Description: TODO
Filter
History
Collections
All
Me
Team
整车3.0测试
17 requests
整车生产
8 requests
esb调用整车页面
2 requests
plateform
1 request
Postman Echo
38 requests
RWCS2.0接口
5 requests
整车本地
9 requests
短信
1 request
POST
11
运输回访接口 copy
中都订单接口测试
中都-铁路接口 copy
司机交车
http://118.31.174.89:8088/sms.
11
http://118.31.174.89:8088/v2sm

No Environment
11
Examples (0)
GET
127.0.0.1:9901/addDataTest
Params
Send
Save
Authorization
Headers(1)
Body
Pre-request Script
Tests
Cookies
Code

 * @Author liupantao
 * @Date 2022/10/20
 * @Version V1.0
 **/
@Controller
public class TpressureDataContoller {

    @Autowired
    private TpressureDataService tpressureDataService;

    @RequestMapping(value = "/addDataTest")
    @ResponseBody
    public boolean addDataTest(){
        TpressureData data= new TpressureData ();
        data.setCreateTime (new Date ());
        data.setName ("test");
        boolean save = tpressureDataService.save (data);
        return  save;
    }

    @RequestMapping(value = "/getDataTest")
    @ResponseBody
    public String getDataTest(){
        List<TpressureData> list = tpressureDataService.list ();
        return  list.size ()+"";
    }
    @RequestMapping(value = "/addDataTest2")
    @ResponseBody
    @Transactional
    public String addDataTest2(){
        TpressureData data= new TpressureData ();
        data.setCreateTime (new Date ());
        data.setName ("test");
        boolean save = tpressureDataService.save (data);
        List<TpressureData> list = tpressureDataService.list ();
        return  save+"";
    }
    @RequestMapping(value = "/addDataTest3")
    @ResponseBody
    public String addDataTest3(){
        TpressureData data= new TpressureData ();
        data.setCreateTime (new Date ());
        data.setName ("test");
        boolean save = tpressureDataService.save (data);
        List<TpressureData> list = tpressureDataService.list ();
        return  save+"";
    }
}
